//
//  SellTableViewCell.m
//  BusinessApp
//
//  Created by macox on 16/9/27.
//  Copyright © 2016年 macox. All rights reserved.
//

#import "SellTableViewCell.h"

@implementation SellTableViewCell
- (void)setMyModel:(ProductSaleStatusModel *)myModel{
    _ProductName.text = myModel.ProductName;
    NSString *string = [NSString stringWithFormat:@"%@%@",ReleaseORDebug,myModel.ImagePath];
 
    NSURL *URL = [NSURL URLWithString:string];
       NSLog(@"***********%@",URL );
//    [_imageProduct sd_setImageWithURL:URL];
    [_imageProduct sd_setImageWithURL:URL placeholderImage:[UIImage imageNamed:@"占位图3.png"]];

    _PriceLabel.text = [NSString stringWithFormat:@"¥%.2f",myModel.MinSalePrice.doubleValue] ;
    if ([myModel.MinSalePrice isEqual:myModel.MarketPrice]) {
        _markLabel.textColor = [UIColor whiteColor];
        _LineView.backgroundColor = [UIColor whiteColor];
    } else{
        _markLabel.textColor = [UIColor grayColor];
        _LineView.backgroundColor = [UIColor grayColor];
    }
    _markLabel.text = [NSString stringWithFormat:@"%.2f",myModel.MarketPrice.doubleValue];
    _StockLabel.text = [NSString stringWithFormat:@"库存 %@",myModel.Stock];
    _TimeLabel.text = myModel.AddedDate;
    self.ProID = [NSString stringWithFormat:@"%d",myModel.Id] ;

    
}
- (void)awakeFromNib {
    
    [super awakeFromNib];
    
    _GroundingBtn.layer.borderWidth = 0.5f;
    
    _GroundingBtn.layer.borderColor = [[UIColor grayColor]CGColor];
    
    
    _DelectBtn.layer.borderWidth = 0.5f;
    
    _DelectBtn.layer.borderColor = [[UIColor grayColor]CGColor];
    


    // Initialization code
}
- (IBAction)UnderGoodsAction:(UIButton *)sender {
    [self.delegate UndercarriageVC:self.ProID];
}
- (IBAction)DelectAction:(UIButton *)sender {
    [self.delegate UndercarriageDelegateVC:self.ProID];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
